// 1. 要有组件
import { createWebHashHistory, createRouter } from 'vue-router';
// 2. 定义一些路由（路径与组件之间的映射）
const routes = [
    //登录
    {name: 'login',path: '/', component: ()=>import('@/view/Login.vue')},
    // 用户
    {name: 'indexuser',path: '/user/index', component: ()=>import('@/view/user/index.vue'),
    children:[
        {name: 'seckill',path: '/seckill', component: ()=>import('@/view/seckill.vue')},
        // {name: 'adminlogin',path: '/adminlogin', component: ()=>import('@/view/admin/AdminLogin.vue')},
        {name: 'userlogin',path: '/userlogin', component: ()=>import('@/view/user/UserLogin.vue')},
        // {name: 'login',path: '/login', component: ()=>import('@/view/Login.vue')},
        {name: 'user',path: '/user', component: ()=>import('@/view/admin/User.vue')},
        {name: 'concert_show',path: '/concert_show', component: ()=>import('@/view/user/ConcertShow.vue')},
        {name:'userorder',path: '/userorder', component: ()=>import('@/view/user/orders.vue')},
        {name:'userpayment',path: '/userpayment', component: ()=>import('@/view/user/payments.vue')},

        // {name:'concert_show_admin',path: '/concert_show_admin', component: ()=>import('@/view/admin/ConcertShow.vue')},
        // {name:'TicketZone',path: '/TicketZone', component: ()=>import('@/view/admin/TicketZone.vue')},
        // {name:'venue',path: '/venue', component: ()=>import('@/view/admin/Venue.vue')},
        // {name:'conresult',path: '/conresult', component: ()=>import('@/view/admin/Conresult.vue')},
        // {name:'order',path: '/order', component: ()=>import('@/view/admin/Order.vue')},
        // {name:'payment',path: '/payment', component: ()=>import('@/view/admin/Payment.vue')},

    ]
    },
    //管理员
    {name: 'indexadmin',path: '/admin/index', component: ()=>import('@/view/admin/index.vue'),
        children:[
            // {name: 'seckill',path: '/seckill', component: ()=>import('@/view/seckill.vue')},
            {name: 'adminlogin',path: '/adminlogin', component: ()=>import('@/view/admin/AdminLogin.vue')},
            // {name: 'userlogin',path: '/userlogin', component: ()=>import('@/view/user/UserLogin.vue')},
            // {name: 'login',path: '/login', component: ()=>import('@/view/Login.vue')},
            {name: 'user',path: '/user', component: ()=>import('@/view/admin/User.vue')},
            // {name: 'concert_show',path: '/concert_show', component: ()=>import('@/view/user/ConcertShow.vue')},
            {name:'concert_show_admin',path: '/concert_show_admin', component: ()=>import('@/view/admin/ConcertShow.vue')},
            {name:'TicketZone',path: '/TicketZone', component: ()=>import('@/view/admin/TicketZone.vue')},
            {name:'venue',path: '/venue', component: ()=>import('@/view/admin/Venue.vue')},
            {name:'conresult',path: '/conresult', component: ()=>import('@/view/admin/Conresult.vue')},
            {name:'order',path: '/order', component: ()=>import('@/view/admin/Order.vue')},
            {name:'payment',path: '/payment', component: ()=>import('@/view/admin/Payment.vue')},

        ]

    },



    // {name: 'index', path: '/', component: ()=>import('@/view/Index.vue'), children: [
    //         {name: 'member',path: '/member', component: ()=>import('@/view/Member.vue')},
    //         {name: 'coach',path: '/coach', component: ()=>import('@/view/Coach.vue')},
    //         {name: 'course',path: '/course', component: ()=>import('@/view/Course.vue')},
    //         {name: 'reserve',path: '/reserve', component: ()=>import('@/view/Reserve.vue')},
    //         {name: 'admin',path: '/admin', component: ()=>import('@/view/Admin.vue')},
    //     ]},
];
// 3. 创建路由
const router = createRouter({
    history: createWebHashHistory(),    // 历史记录
    routes: routes,
});
// 路由是否已经加载
router.load = false;
// 4. 暴露
export default router
